import React, { FC, createElement } from 'react';
import { BaseWrapper } from '../base';
import { useFormContainerSelector } from '../../form-container';
import { generatorClass } from '../../utils';
import './radioGroup.less';
import classNames from 'classnames';
import { BaseFieldRadio } from './base-field-radio';

export interface FieldRadioGroupProps {
  max:string
}

export const FieldRadioGroup: FC<FieldRadioGroupProps> = (props) => {
  const className = classNames(generatorClass('filed-radio-group'));
  const { columnConfig } = props;
  const [readonly] = useFormContainerSelector((s) => [s.readonly]);

  return (
    <BaseWrapper {...props}>
      <BaseFieldRadio
        className={className}
        innerProps={{
          disabled: readonly || columnConfig?.status === '2',
        }}
        {...props}
      />
    </BaseWrapper>
  );
};
